<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/base/base.jsp"%>
<%@ include file="/base/database.jsp"%>

	<%
		String courseID=request.getParameter("courseID");
		
		Connection conn=getConn();
		
		String sql="select * from sys_course where courseID=?";
		
		PreparedStatement pstmt=conn.prepareStatement(sql);
		
		pstmt.setString(1,courseID);
		
		ResultSet rs=pstmt.executeQuery();
		
		String rs_courseID="";
		String rs_classID="";
		String rs_courseName="";
		String rs_year="";
		String rs_term="";
		String rs_hour="";

		if(rs.next()){
			rs_courseID=rs.getString("courseID");
			rs_classID=rs.getString("classID");
			rs_courseName=rs.getString("courseName");
			rs_year=rs.getString("year");
			rs_term=rs.getString("term");
			rs_hour=rs.getString("hour");
			
		}
		
		session.setAttribute("rs_courseID", rs_courseID);
		session.setAttribute("rs_classID",rs_classID);
		session.setAttribute("rs_courseName", rs_courseName);
		session.setAttribute("rs_year",rs_year);
		session.setAttribute("rs_term",rs_term);
		session.setAttribute("rs_hour",rs_hour);
				
				
		if(pstmt!=null){
			pstmt.close();
		}
		if(conn!=null){
			conn.close();
		}
		
		process(request,response,"course_search.jsp");
	%>